gusucode.com > VC 在窗体状态栏中插入输入控件源码程序VC 在窗体状态栏中 > VC 在窗体状态栏中插入输入控件源码程序/code/MyStatusView.cpp
// MyStatusView.cpp : implementation of the CMyStatusView class // Download by http://www.NewXing.com #include "stdafx.h" #include <afxcview.h> #include "MyStatus.h" #include "MyStatusDoc.h" #include "MyStatusView.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CMyStatusView IMPLEMENT_DYNCREATE(CMyStatusView, CView) BEGIN_MESSAGE_MAP(CMyStatusView, CView) //{{AFX_MSG_MAP(CMyStatusView) // NOTE - the ClassWizard will add and remove mapping macros here. // DO NOT EDIT what you see in these blocks of generated code! //}}AFX_MSG_MAP // Standard printing commands ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint) ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint) ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview) END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CMyStatusView construction/destruction CMyStatusView::CMyStatusView() { // TODO: add construction code here } CMyStatusView::~CMyStatusView() { } BOOL CMyStatusView::PreCreateWindow(CREATESTRUCT& cs) { // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs return CView::PreCreateWindow(cs); } ///////////////////////////////////////////////////////////////////////////// // CMyStatusView drawing void CMyStatusView::OnDraw(CDC* pDC) { CMyStatusDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); // TODO: add draw code for native data here } ///////////////////////////////////////////////////////////////////////////// // CMyStatusView printing BOOL CMyStatusView::OnPreparePrinting(CPrintInfo* pInfo) { // default preparation return DoPreparePrinting(pInfo); } void CMyStatusView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) { // TODO: add extra initialization before printing } void CMyStatusView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) { // TODO: add cleanup after printing } ///////////////////////////////////////////////////////////////////////////// // CMyStatusView diagnostics #ifdef _DEBUG void CMyStatusView::AssertValid() const { CView::AssertValid(); } void CMyStatusView::Dump(CDumpContext& dc) const { CView::Dump(dc); } CMyStatusDoc* CMyStatusView::GetDocument() // non-debug version is inline { ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMyStatusDoc))); return (CMyStatusDoc*)m_pDocument; } #endif //_DEBUG ///////////////////////////////////////////////////////////////////////////// // CMyStatusView message handlers void CMyStatusView::AddString(CString s) { CClientDC dc(this); dc.TextOut(10,10,s); return ; }